Change Initial Country For Caldera Forms Phone Fields

73

<?php
/**
* Set intiial country for Caldera Forms phone fields
*/
add_filter( 'caldera_forms_phone_js_options', function( $options){
	//Use ISO_3166-1_alpha-2 formatted country code
	$options[ 'initialCountry' ] = 'CH';
	return $options;
});
<?php
/**
 * Show only specific countries' flag in Caldera Forms phone fields
 */
add_filter( 'caldera_forms_phone_js_options', function($options ){
	$options[ 'onlyCountries' ] = array( 'cn', 'tw' );
	return $options;
});

Comments

Submit
0 Comments